# 无需安装，下载Ashare.py并导入
from Ashare import get_price
# 获取5分钟级分时数据
stock_code = 'sz002468'
frequency = '1m'
df = get_price(stock_code, frequency=frequency, count=100)  # 上证指数近100条5分钟数据

print("原始数据预览：\n", df.head(2))  # 打印前2行确认数据

# 保存为JSON文件
output =  fr'D:\work\code\clark\gitee\big_a\datas\kline_now\{stock_code}_{frequency}.json'
df.to_json(output, orient='records', indent=4)
print(fr'\n✅ 数据已保存至 stock_data.json{output}')